Revision: tla--peek-str-const--1.3.1--version-0
Archive: lord@emf.net--libawk-exp-2005
Creator: Thomas Lord <lord@emf.net>
Date: Sun Feb 13 19:51:48 PST 2005
Standard-date: 2005-02-14 03:51:48 GMT
New-patches: lord@emf.net--libawk-exp-2005/tla--peek-str-const--1.3.1--version-0
Summary: log message
Keywords: 

* Step 3: `const'-ify relational and associative tables


  [[cartouche
     /Note:/

     A prerequesit for these changes are some changes to `hackerlab':

     /Archive:/ `lord@emf.net--2005'

     /Version:/ `hackerlab--devo--1.1'

     /Revisions:/ `patch-2'
  ]]

  Keys and values returned from associative table functions and
  strings returned by `rel_peek_record' are "owned" by `libawk'.
  `libawk' is responsible for their memory management (they have a
  dynamic extent limited by the next mutation to the associative
  binding or relational table slot they were read from).  `libawk'
  is permitted to share the data in these strings for more than
  one key, value, or table element.

  Therefore, it is an error for `libawk' clients to modify these
  strings, to reallocate them, or to free them.  For some time,
  `libarch' in `tla' has violated all three of these rules, in some
  cases in the form of outright bugs rather than mere abstraction
  violations.

  To help detect such errors, `const' was added to the declarations in
  `libawk'.  This introduced many compilation errors which could, for
  the most part, be fixed by adding `const' declarations to other
  files (which might in turn, introduce still more compilation
  errors).  This procedure was iterated until all errors were
  eliminated, resulting in changes throughout `tla' and some in
  `hackerlab'.  A few outright bugs in `libarch' were uncovered in the
  process (and fixed).



